<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script src="../node_modules/@vue/reactivity/dist/reactivity.global.js"></script>
    <div id="app"></div>
    <script>
      let { reactive, effect } = VueReactivity;
      let state = reactive({ name: "hl", age: "18", base: { add: "sh" } });
      effect(() => {
        app.innerHTML = state.name;
        state.base;
        state.base.add;
      });

      setTimeout(() => {
        // 触发更新
        state.name = "hulei";
      }, 3000);

      setTimeout(() => {
        // 不触发更新
        state.age = 10;
      }, 6000);
    </script>
  </body>
</html>
